﻿@using Peresvet.Common.Constants
@model Peresvet.Models.NewsItemModel
@{
	ViewBag.Title = "Новости";
}

@if (Model != null)
{
	<div class="news1">
		<div class="text">
			@(!string.IsNullOrWhiteSpace(Model.Header)
				? Model.Header
				: string.Empty)
		</div>
		<a href="@(Url.Action<HomeController>(m => m.Gallery(Model.GalleryId)))">
			<img src="../../@(!string.IsNullOrWhiteSpace(Model.ImageUrl)
				                  ? Model.ImageUrl
				                  : ApplicationSettings.DEFAULT_NEWS_IMAGE_URL)" />
		</a>
		@if (Model.Description != null)
		{
			foreach (var paragraph in Model.Description.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
			{
				<p>@(paragraph ?? string.Empty)</p>
			}
		}
	</div>
}